package com.dzu.easy;

/**
 * @author ZhaoDong
 * @date 2022/12/5 9:01
 * @description 171. Excel 表列序号
 */
public class Test171 {
    public static void main(String[] args) {

        System.out.println(titleToNumber("ZY"));
    }

    public static int titleToNumber(String columnTitle) {

        int resp = 0;
        for (char c : columnTitle.toCharArray()) {
            resp = resp * 26 + (c - 'A' + 1);
        }

        return resp;

    }
}
